<?php $this->template->add_css_admin(array(
								'css/colorpicker.css',
								'css/datepicker.css',
								'css/icheck/flat/blue.css',
								'css/select2.css',
								'css/unicorn.main.css',
								'css/unicorn.grey.css',
								)); 
?>
<form method="post"  enctype="multipart/form-data" class="form-horizontal">
<div class="row">
	<div class="col-12">
		<div class="widget-box">
			<div class="widget-title">
				<span class="icon">
					<i class="glyphicon glyphicon-align-justify"></i>									
				</span>
				<h5><?php echo ((@$edit->{$this->{$this->model}->primaryKey} > 0)?'Thông tin ':'Thêm mới ').@strtolower($this->resource->RES_NAME);?></h5>
			</div>
			<div class="widget-content nopadding">
				<div class="form-group">
					<label class="control-label" for="myid_81">Tên danh mục</label>
					<div class="controls">
						<input type="text" id="myid_81" name="edit[cat_name]" class="span6   form-control input-small" value="<?php echo @$edit->cat_name;?>">
					</div>
				</div>
				
				<div class="form-group">
					<label class="control-label">Trạng thái</label>
					<div class="controls">
						<select name="edit[cat_parent]">
							<?php 
								foreach ($cate_tree as $key => $value){
									$selected = @$edit->cat_parent == $key?'selected':'';									
									echo '<option value="'.$key.'" '.$selected.' >'.$value.'</option>';
								}
							?>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" >Sắp xếp</label>
					<div class="controls">
						<input type="text" name="edit[cat_order]" class="span6 form-control input-small" value="<?php echo @$edit->cat_order;?>" />
					</div>
				</div>
				
				<div class="form-group">
					<label class="control-label" for="myid_68">Chú thích</label>
					<div class="controls">
						<textarea id="myid_68" name="edit[cat_description]" class="span6  form-control"><?php echo @$edit->cat_description;?></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">Trạng thái</label>
					<div class="controls">
						<select name="edit[cat_status]">
							<option value='0' <?php echo @$edit->cat_status==0?'selected':''?> >Ẩn</option>
							<option value='1' <?php echo @$edit->cat_status==1?'selected':''?> >Sử dụng</option>
						</select>
					</div>
				</div>
				<div class="form-actions">
					<button type="submit" class="btn btn-primary btn-small">Add</button> or <a class="text-danger" href="http://localhost/saovui/admin/category">Cancel</a>
				</div>
			</div>
		</div>
	</div>					
</div>
</form>
<?php $this->template->add_js_admin(array('js/bootstrap-colorpicker.js',
									'js/bootstrap-datepicker.js',
									'js/jquery.icheck.min.js',
									'js/select2.min.js',
									'js/unicorn.form_common.js',
									'ckeditor/ckeditor.js',
									)); 
?>
<?php ob_start();?>
<script type="text/javascript">
	function printValue(el,value){
		$("#"+el).val(value);
	}
</script>
<?php $this->template->add_raw_html(ob_get_clean());